<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
   OpenAPI Petstore

   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \&quot; \\

   OpenAPI Version: 3.0.1
   OpenAPI Petstore API version: 1.0.0
   Generated by OpenAPI Generator (https://openapi-generator.tech)
-}</span><span>
</span><a name="line-10"></a><span>
</span><a name="line-11"></a><span class="hs-comment">{-|
Module : OpenAPIPetstore.Client
-}</span><span>
</span><a name="line-14"></a><span>
</span><a name="line-15"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
</span><a name="line-16"></a><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><a name="line-19"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><a name="line-20"></a><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><a name="line-21"></a><span class="hs-pragma">{-# LANGUAGE DeriveFoldable #-}</span><span>
</span><a name="line-22"></a><span class="hs-pragma">{-# LANGUAGE DeriveTraversable #-}</span><span>
</span><a name="line-23"></a><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}</span><span>
</span><a name="line-24"></a><span>
</span><a name="line-25"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">OpenAPIPetstore.Client</span><span> </span><span class="hs-keyword">where</span><span>
</span><a name="line-26"></a><span>
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><a href="OpenAPIPetstore.Core.html"><span class="hs-identifier">OpenAPIPetstore.Core</span></a><span>
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><a href="OpenAPIPetstore.Logging.html"><span class="hs-identifier">OpenAPIPetstore.Logging</span></a><span>
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html"><span class="hs-identifier">OpenAPIPetstore.MimeTypes</span></a><span>
</span><a name="line-30"></a><span>
</span><a name="line-31"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control.Exception.Safe</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">E</span><span>
</span><a name="line-32"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control.Monad.IO.Class</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
</span><a name="line-33"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control.Monad</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
</span><a name="line-34"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Aeson.Types</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
</span><a name="line-35"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.ByteString.Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BC</span><span>
</span><a name="line-36"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.ByteString.Lazy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BL</span><span>
</span><a name="line-37"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.ByteString.Lazy.Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BCL</span><span>
</span><a name="line-38"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Proxy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Proxy</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-39"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
</span><a name="line-40"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data.Text.Encoding</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
</span><a name="line-41"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network.HTTP.Client</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
</span><a name="line-42"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network.HTTP.Client.MultipartFormData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
</span><a name="line-43"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network.HTTP.Types</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
</span><a name="line-44"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Web.FormUrlEncoded</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
</span><a name="line-45"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Web.HttpApiData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
</span><a name="line-46"></a><span>
</span><a name="line-47"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Function</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var">&amp;</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-48"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Monoid</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var">&lt;&gt;</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-49"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Text</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Text</span><span class="hs-special">)</span><span>
</span><a name="line-50"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC.Exts</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">IsString</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-51"></a><span>
</span><a name="line-52"></a><span class="hs-comment">-- * Dispatch</span><span>
</span><a name="line-53"></a><span>
</span><a name="line-54"></a><span class="hs-comment">-- ** Lbs</span><span>
</span><a name="line-55"></a><span>
</span><a name="line-56"></a><span class="hs-comment">-- | send a request returning the raw http response</span><span>
</span><a name="line-57"></a><span class="hs-identifier">dispatchLbs</span><span>
</span><a name="line-58"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679132872"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132873"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132874"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
</span><a name="line-59"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier hs-type">NH.Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
</span><a name="line-60"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
</span><a name="line-61"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreRequest"><span class="hs-identifier hs-type">OpenAPIPetstoreRequest</span></a><span> </span><a href="#local-6989586621679132872"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132874"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132875"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132873"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
</span><a name="line-62"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH.Response</span><span> </span><span class="hs-identifier hs-type">BCL.ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
</span><a name="line-63"></a><a name="dispatchLbs"><a href="OpenAPIPetstore.Client.html#dispatchLbs"><span class="hs-identifier">dispatchLbs</span></a></a><span> </span><a name="local-6989586621679132876"><a href="#local-6989586621679132876"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679132877"><a href="#local-6989586621679132877"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679132878"><a href="#local-6989586621679132878"><span class="hs-identifier">request</span></a></a><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-64"></a><span>  </span><a name="local-6989586621679132879"><a href="#local-6989586621679132879"><span class="hs-identifier">initReq</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><a href="OpenAPIPetstore.Client.html#_toInitRequest"><span class="hs-identifier hs-var">_toInitRequest</span></a><span> </span><a href="#local-6989586621679132877"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679132878"><span class="hs-identifier hs-var">request</span></a><span>
</span><a name="line-65"></a><span>  </span><a href="OpenAPIPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier hs-var">dispatchInitUnsafe</span></a><span> </span><a href="#local-6989586621679132876"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679132877"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679132879"><span class="hs-identifier hs-var">initReq</span></a><span>
</span><a name="line-66"></a><span>
</span><a name="line-67"></a><span class="hs-comment">-- ** Mime</span><span>
</span><a name="line-68"></a><span>
</span><a name="line-69"></a><span class="hs-comment">-- | pair of decoded http body and http response</span><span>
</span><a name="line-70"></a><span class="hs-keyword">data</span><span> </span><a name="MimeResult"><a href="OpenAPIPetstore.Client.html#MimeResult"><span class="hs-identifier">MimeResult</span></a></a><span> </span><a name="local-6989586621679132840"><a href="#local-6989586621679132840"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">=</span><span>
</span><a name="line-71"></a><span>  </span><a name="MimeResult"><a href="OpenAPIPetstore.Client.html#MimeResult"><span class="hs-identifier">MimeResult</span></a></a><span> </span><span class="hs-special">{</span><span> </span><a name="mimeResult"><a href="OpenAPIPetstore.Client.html#mimeResult"><span class="hs-identifier">mimeResult</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Either</span><span> </span><a href="OpenAPIPetstore.Client.html#MimeError"><span class="hs-identifier hs-type">MimeError</span></a><span> </span><a href="#local-6989586621679132840"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ decoded http body</span><span>
</span><a name="line-72"></a><span>             </span><span class="hs-special">,</span><span> </span><a name="mimeResultResponse"><a href="OpenAPIPetstore.Client.html#mimeResultResponse"><span class="hs-identifier">mimeResultResponse</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH.Response</span><span> </span><span class="hs-identifier hs-type">BCL.ByteString</span><span> </span><span class="hs-comment">-- ^ http response </span><span>
</span><a name="line-73"></a><span>             </span><span class="hs-special">}</span><span>
</span><a name="line-74"></a><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Functor</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Foldable</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Traversable</span><span class="hs-special">)</span><span>
</span><a name="line-75"></a><span>
</span><a name="line-76"></a><span class="hs-comment">-- | pair of unrender/parser error and http response</span><span>
</span><a name="line-77"></a><span class="hs-keyword">data</span><span> </span><a name="MimeError"><a href="OpenAPIPetstore.Client.html#MimeError"><span class="hs-identifier">MimeError</span></a></a><span> </span><span class="hs-glyph">=</span><span>
</span><a name="line-78"></a><span>  </span><a name="MimeError"><a href="OpenAPIPetstore.Client.html#MimeError"><span class="hs-identifier">MimeError</span></a></a><span> </span><span class="hs-special">{</span><span>
</span><a name="line-79"></a><span>    </span><a name="mimeError"><a href="OpenAPIPetstore.Client.html#mimeError"><span class="hs-identifier">mimeError</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-comment">-- ^ unrender/parser error</span><span>
</span><a name="line-80"></a><span>  </span><span class="hs-special">,</span><span> </span><a name="mimeErrorResponse"><a href="OpenAPIPetstore.Client.html#mimeErrorResponse"><span class="hs-identifier">mimeErrorResponse</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH.Response</span><span> </span><span class="hs-identifier hs-type">BCL.ByteString</span><span> </span><span class="hs-comment">-- ^ http response </span><span>
</span><a name="line-81"></a><span>  </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Eq</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Show</span><span class="hs-special">)</span><span>
</span><a name="line-82"></a><span>
</span><a name="line-83"></a><span class="hs-comment">-- | send a request returning the 'MimeResult'</span><span>
</span><a name="line-84"></a><span class="hs-identifier">dispatchMime</span><span>
</span><a name="line-85"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><a name="local-6989586621679132868"><a href="#local-6989586621679132868"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679132869"><a href="#local-6989586621679132869"><span class="hs-identifier">contentType</span></a></a><span> </span><a name="local-6989586621679132870"><a href="#local-6989586621679132870"><span class="hs-identifier">res</span></a></a><span> </span><a name="local-6989586621679132871"><a href="#local-6989586621679132871"><span class="hs-identifier">accept</span></a></a><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679132868"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132871"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="#local-6989586621679132871"><span class="hs-identifier hs-type">accept</span></a><span> </span><a href="#local-6989586621679132870"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132869"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
</span><a name="line-86"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier hs-type">NH.Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
</span><a name="line-87"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
</span><a name="line-88"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreRequest"><span class="hs-identifier hs-type">OpenAPIPetstoreRequest</span></a><span> </span><a href="#local-6989586621679132868"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132869"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132870"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132871"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
</span><a name="line-89"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#MimeResult"><span class="hs-identifier hs-type">MimeResult</span></a><span> </span><a href="#local-6989586621679132870"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
</span><a name="line-90"></a><a name="dispatchMime"><a href="OpenAPIPetstore.Client.html#dispatchMime"><span class="hs-identifier">dispatchMime</span></a></a><span> </span><a name="local-6989586621679132880"><a href="#local-6989586621679132880"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679132881"><a href="#local-6989586621679132881"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679132882"><a href="#local-6989586621679132882"><span class="hs-identifier">request</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-91"></a><span>  </span><a name="local-6989586621679132883"><a href="#local-6989586621679132883"><span class="hs-identifier">httpResponse</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><a href="OpenAPIPetstore.Client.html#dispatchLbs"><span class="hs-identifier hs-var">dispatchLbs</span></a><span> </span><a href="#local-6989586621679132880"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679132881"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679132882"><span class="hs-identifier hs-var">request</span></a><span>
</span><a name="line-92"></a><span>  </span><span class="hs-keyword">let</span><span> </span><a name="local-6989586621679132884"><a href="#local-6989586621679132884"><span class="hs-identifier">statusCode</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">NH.statusCode</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH.responseStatus</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="#local-6989586621679132883"><span class="hs-identifier hs-var">httpResponse</span></a><span>
</span><a name="line-93"></a><span>  </span><a name="local-6989586621679133384"><a href="#local-6989586621679133384"><span class="hs-identifier">parsedResult</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><a name="line-94"></a><span>    </span><a href="OpenAPIPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><span class="hs-string">&quot;Client&quot;</span><span> </span><a href="#local-6989586621679132881"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span>
</span><a name="line-95"></a><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679132884"><span class="hs-identifier hs-var">statusCode</span></a><span> </span><span class="hs-operator hs-var">&gt;=</span><span> </span><span class="hs-number">400</span><span> </span><span class="hs-operator hs-var">&amp;&amp;</span><span> </span><a href="#local-6989586621679132884"><span class="hs-identifier hs-var">statusCode</span></a><span> </span><span class="hs-operator hs-var">&lt;</span><span> </span><span class="hs-number">600</span><span class="hs-special">)</span><span>
</span><a name="line-96"></a><span>         </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-97"></a><span>           </span><span class="hs-keyword">let</span><span> </span><a name="local-6989586621679133381"><a href="#local-6989586621679133381"><span class="hs-identifier">s</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">&quot;error statusCode: &quot;</span><span> </span><span class="hs-operator hs-var">++</span><span> </span><span class="hs-identifier hs-var">show</span><span> </span><a href="#local-6989586621679132884"><span class="hs-identifier hs-var">statusCode</span></a><span>
</span><a name="line-98"></a><span>           </span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><span class="hs-string">&quot;Client&quot;</span><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#levelError"><span class="hs-identifier hs-var">levelError</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T.pack</span><span> </span><a href="#local-6989586621679133381"><span class="hs-identifier hs-var">s</span></a><span class="hs-special">)</span><span>
</span><a name="line-99"></a><span>           </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Left</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#MimeError"><span class="hs-identifier hs-var">MimeError</span></a><span> </span><a href="#local-6989586621679133381"><span class="hs-identifier hs-var">s</span></a><span> </span><a href="#local-6989586621679132883"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-100"></a><span>         </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">case</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier hs-var">mimeUnrender</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P.Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P.Proxy</span><span> </span><a href="#local-6989586621679132871"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">NH.responseBody</span><span> </span><a href="#local-6989586621679132883"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><a name="line-101"></a><span>           </span><span class="hs-identifier hs-var">Left</span><span> </span><a name="local-6989586621679133382"><a href="#local-6989586621679133382"><span class="hs-identifier">s</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-102"></a><span>             </span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><span class="hs-string">&quot;Client&quot;</span><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#levelError"><span class="hs-identifier hs-var">levelError</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T.pack</span><span> </span><a href="#local-6989586621679133382"><span class="hs-identifier hs-var">s</span></a><span class="hs-special">)</span><span>
</span><a name="line-103"></a><span>             </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Left</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#MimeError"><span class="hs-identifier hs-var">MimeError</span></a><span> </span><a href="#local-6989586621679133382"><span class="hs-identifier hs-var">s</span></a><span> </span><a href="#local-6989586621679132883"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-104"></a><span>           </span><span class="hs-identifier hs-var">Right</span><span> </span><a name="local-6989586621679133383"><a href="#local-6989586621679133383"><span class="hs-identifier">r</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Right</span><span> </span><a href="#local-6989586621679133383"><span class="hs-identifier hs-var">r</span></a><span class="hs-special">)</span><span>
</span><a name="line-105"></a><span>  </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#MimeResult"><span class="hs-identifier hs-var">MimeResult</span></a><span> </span><a href="#local-6989586621679133384"><span class="hs-identifier hs-var">parsedResult</span></a><span> </span><a href="#local-6989586621679132883"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span>
</span><a name="line-106"></a><span>
</span><a name="line-107"></a><span class="hs-comment">-- | like 'dispatchMime', but only returns the decoded http body</span><span>
</span><a name="line-108"></a><span class="hs-identifier">dispatchMime'</span><span>
</span><a name="line-109"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679132864"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132865"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="#local-6989586621679132865"><span class="hs-identifier hs-type">accept</span></a><span> </span><a href="#local-6989586621679132866"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132867"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
</span><a name="line-110"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier hs-type">NH.Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
</span><a name="line-111"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
</span><a name="line-112"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreRequest"><span class="hs-identifier hs-type">OpenAPIPetstoreRequest</span></a><span> </span><a href="#local-6989586621679132864"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132867"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132866"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132865"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
</span><a name="line-113"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Either</span><span> </span><a href="OpenAPIPetstore.Client.html#MimeError"><span class="hs-identifier hs-type">MimeError</span></a><span> </span><a href="#local-6989586621679132866"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
</span><a name="line-114"></a><a name="dispatchMime%27"><a href="OpenAPIPetstore.Client.html#dispatchMime%27"><span class="hs-identifier">dispatchMime'</span></a></a><span> </span><a name="local-6989586621679133385"><a href="#local-6989586621679133385"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679133386"><a href="#local-6989586621679133386"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679133387"><a href="#local-6989586621679133387"><span class="hs-identifier">request</span></a></a><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-115"></a><span>    </span><a href="OpenAPIPetstore.Client.html#MimeResult"><span class="hs-identifier hs-var">MimeResult</span></a><span> </span><a name="local-6989586621679133388"><a href="#local-6989586621679133388"><span class="hs-identifier">parsedResult</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><a href="OpenAPIPetstore.Client.html#dispatchMime"><span class="hs-identifier hs-var">dispatchMime</span></a><span> </span><a href="#local-6989586621679133385"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679133386"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679133387"><span class="hs-identifier hs-var">request</span></a><span>
</span><a name="line-116"></a><span>    </span><span class="hs-identifier hs-var">return</span><span> </span><a href="#local-6989586621679133388"><span class="hs-identifier hs-var">parsedResult</span></a><span>
</span><a name="line-117"></a><span>
</span><a name="line-118"></a><span class="hs-comment">-- ** Unsafe</span><span>
</span><a name="line-119"></a><span>
</span><a name="line-120"></a><span class="hs-comment">-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the &quot;accept&quot; 'MimeType'.  (Useful if the server's response is undocumented)</span><span>
</span><a name="line-121"></a><span class="hs-identifier">dispatchLbsUnsafe</span><span>
</span><a name="line-122"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132860"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132861"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
</span><a name="line-123"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier hs-type">NH.Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
</span><a name="line-124"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
</span><a name="line-125"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreRequest"><span class="hs-identifier hs-type">OpenAPIPetstoreRequest</span></a><span> </span><a href="#local-6989586621679132862"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132861"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132863"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132860"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
</span><a name="line-126"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH.Response</span><span> </span><span class="hs-identifier hs-type">BCL.ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
</span><a name="line-127"></a><a name="dispatchLbsUnsafe"><a href="OpenAPIPetstore.Client.html#dispatchLbsUnsafe"><span class="hs-identifier">dispatchLbsUnsafe</span></a></a><span> </span><a name="local-6989586621679133389"><a href="#local-6989586621679133389"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679133390"><a href="#local-6989586621679133390"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679133391"><a href="#local-6989586621679133391"><span class="hs-identifier">request</span></a></a><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-128"></a><span>  </span><a name="local-6989586621679133392"><a href="#local-6989586621679133392"><span class="hs-identifier">initReq</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><a href="OpenAPIPetstore.Client.html#_toInitRequest"><span class="hs-identifier hs-var">_toInitRequest</span></a><span> </span><a href="#local-6989586621679133390"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679133391"><span class="hs-identifier hs-var">request</span></a><span>
</span><a name="line-129"></a><span>  </span><a href="OpenAPIPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier hs-var">dispatchInitUnsafe</span></a><span> </span><a href="#local-6989586621679133389"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679133390"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679133392"><span class="hs-identifier hs-var">initReq</span></a><span>
</span><a name="line-130"></a><span>
</span><a name="line-131"></a><span class="hs-comment">-- | dispatch an InitRequest</span><span>
</span><a name="line-132"></a><span class="hs-identifier">dispatchInitUnsafe</span><span>
</span><a name="line-133"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH.Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
</span><a name="line-134"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
</span><a name="line-135"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679132856"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132857"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132858"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132859"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ init request</span><span>
</span><a name="line-136"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH.Response</span><span> </span><span class="hs-identifier hs-type">BCL.ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
</span><a name="line-137"></a><a name="dispatchInitUnsafe"><a href="OpenAPIPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier">dispatchInitUnsafe</span></a></a><span> </span><a name="local-6989586621679133393"><a href="#local-6989586621679133393"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679133394"><a href="#local-6989586621679133394"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679133395"><a href="#local-6989586621679133395"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-138"></a><span>  </span><a href="OpenAPIPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><a href="#local-6989586621679133396"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="#local-6989586621679133394"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span>
</span><a name="line-139"></a><span>    </span><span class="hs-keyword">do</span><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679133396"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#levelInfo"><span class="hs-identifier hs-var">levelInfo</span></a><span> </span><a href="#local-6989586621679133398"><span class="hs-identifier hs-var">requestLogMsg</span></a><span>
</span><a name="line-140"></a><span>       </span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679133396"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#levelDebug"><span class="hs-identifier hs-var">levelDebug</span></a><span> </span><a href="#local-6989586621679133399"><span class="hs-identifier hs-var">requestDbgLogMsg</span></a><span>
</span><a name="line-141"></a><span>       </span><a name="local-6989586621679133495"><a href="#local-6989586621679133495"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier hs-var">P.liftIO</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">NH.httpLbs</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span> </span><a href="#local-6989586621679133393"><span class="hs-identifier hs-var">manager</span></a><span>
</span><a name="line-142"></a><span>       </span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679133396"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#levelInfo"><span class="hs-identifier hs-var">levelInfo</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133401"><span class="hs-identifier hs-var">responseLogMsg</span></a><span> </span><a href="#local-6989586621679133495"><span class="hs-identifier hs-var">res</span></a><span class="hs-special">)</span><span>
</span><a name="line-143"></a><span>       </span><a href="OpenAPIPetstore.LoggingKatip.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679133396"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#levelDebug"><span class="hs-identifier hs-var">levelDebug</span></a><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-identifier hs-var">T.pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679133495"><span class="hs-identifier hs-var">res</span></a><span class="hs-special">)</span><span>
</span><a name="line-144"></a><span>       </span><span class="hs-identifier hs-var">return</span><span> </span><a href="#local-6989586621679133495"><span class="hs-identifier hs-var">res</span></a><span>
</span><a name="line-145"></a><span>  </span><span class="hs-keyword">where</span><span>
</span><a name="line-146"></a><span>    </span><a name="local-6989586621679133396"><a href="#local-6989586621679133396"><span class="hs-identifier">src</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">&quot;Client&quot;</span><span>
</span><a name="line-147"></a><span>    </span><a name="local-6989586621679133397"><a href="#local-6989586621679133397"><span class="hs-identifier">endpoint</span></a></a><span> </span><span class="hs-glyph">=</span><span>
</span><a name="line-148"></a><span>      </span><span class="hs-identifier hs-var">T.pack</span><span> </span><span class="hs-operator hs-var">$</span><span>
</span><a name="line-149"></a><span>      </span><span class="hs-identifier hs-var">BC.unpack</span><span> </span><span class="hs-operator hs-var">$</span><span>
</span><a name="line-150"></a><span>      </span><span class="hs-identifier">NH.method</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-string">&quot; &quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-identifier">NH.host</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-identifier">NH.path</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-identifier">NH.queryString</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span>
</span><a name="line-151"></a><span>    </span><a name="local-6989586621679133398"><a href="#local-6989586621679133398"><span class="hs-identifier">requestLogMsg</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">&quot;REQ:&quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><a href="#local-6989586621679133397"><span class="hs-identifier hs-var">endpoint</span></a><span>
</span><a name="line-152"></a><span>    </span><a name="local-6989586621679133399"><a href="#local-6989586621679133399"><span class="hs-identifier">requestDbgLogMsg</span></a></a><span> </span><span class="hs-glyph">=</span><span>
</span><a name="line-153"></a><span>      </span><span class="hs-string">&quot;Headers=&quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T.pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">NH.requestHeaders</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-string">&quot; Body=&quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span>
</span><a name="line-154"></a><span>      </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">NH.requestBody</span><span> </span><a href="#local-6989586621679133395"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-keyword">of</span><span>
</span><a name="line-155"></a><span>         </span><span class="hs-identifier hs-var">NH.RequestBodyLBS</span><span> </span><a name="local-6989586621679133402"><a href="#local-6989586621679133402"><span class="hs-identifier">xs</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">T.decodeUtf8</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">BL.toStrict</span><span> </span><a href="#local-6989586621679133402"><span class="hs-identifier hs-var">xs</span></a><span class="hs-special">)</span><span>
</span><a name="line-156"></a><span>         </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-string">&quot;&lt;RequestBody&gt;&quot;</span><span class="hs-special">)</span><span>
</span><a name="line-157"></a><span>    </span><a name="local-6989586621679133400"><a href="#local-6989586621679133400"><span class="hs-identifier">responseStatusCode</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T.pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH.statusCode</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH.responseStatus</span><span>
</span><a name="line-158"></a><span>    </span><a name="local-6989586621679133401"><a href="#local-6989586621679133401"><span class="hs-identifier">responseLogMsg</span></a></a><span> </span><a name="local-6989586621679133403"><a href="#local-6989586621679133403"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">=</span><span>
</span><a name="line-159"></a><span>      </span><span class="hs-string">&quot;RES:statusCode=&quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><a href="#local-6989586621679133400"><span class="hs-identifier hs-var">responseStatusCode</span></a><span> </span><a href="#local-6989586621679133403"><span class="hs-identifier hs-var">res</span></a><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-string">&quot; (&quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><a href="#local-6989586621679133397"><span class="hs-identifier hs-var">endpoint</span></a><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-string">&quot;)&quot;</span><span>
</span><a name="line-160"></a><span>
</span><a name="line-161"></a><span class="hs-comment">-- * InitRequest</span><span>
</span><a name="line-162"></a><span>
</span><a name="line-163"></a><span class="hs-comment">-- | wraps an http-client 'Request' with request/response type parameters</span><span>
</span><a name="line-164"></a><span class="hs-keyword">newtype</span><span> </span><a name="InitRequest"><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier">InitRequest</span></a></a><span> </span><a name="local-6989586621679132836"><a href="#local-6989586621679132836"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679132837"><a href="#local-6989586621679132837"><span class="hs-identifier">contentType</span></a></a><span> </span><a name="local-6989586621679132838"><a href="#local-6989586621679132838"><span class="hs-identifier">res</span></a></a><span> </span><a name="local-6989586621679132839"><a href="#local-6989586621679132839"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="InitRequest"><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier">InitRequest</span></a></a><span>
</span><a name="line-165"></a><span>  </span><span class="hs-special">{</span><span> </span><a name="unInitRequest"><a href="OpenAPIPetstore.Client.html#unInitRequest"><span class="hs-identifier">unInitRequest</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH.Request</span><span>
</span><a name="line-166"></a><span>  </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">)</span><span>
</span><a name="line-167"></a><span>
</span><a name="line-168"></a><span class="hs-comment">-- |  Build an http-client 'Request' record from the supplied config and request</span><span>
</span><a name="line-169"></a><span class="hs-identifier">_toInitRequest</span><span>
</span><a name="line-170"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132852"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="OpenAPIPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679132853"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
</span><a name="line-171"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
</span><a name="line-172"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreRequest"><span class="hs-identifier hs-type">OpenAPIPetstoreRequest</span></a><span> </span><a href="#local-6989586621679132854"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132853"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132855"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132852"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
</span><a name="line-173"></a><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679132854"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132853"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132855"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132852"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ initialized request</span><span>
</span><a name="line-174"></a><a name="_toInitRequest"><a href="OpenAPIPetstore.Client.html#_toInitRequest"><span class="hs-identifier">_toInitRequest</span></a></a><span> </span><a name="local-6989586621679133496"><a href="#local-6989586621679133496"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679133497"><a href="#local-6989586621679133497"><span class="hs-identifier">req0</span></a></a><span>  </span><span class="hs-glyph">=</span><span>
</span><a name="line-175"></a><span>  </span><a href="OpenAPIPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><span class="hs-string">&quot;Client&quot;</span><span> </span><a href="#local-6989586621679133496"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-keyword">do</span><span>
</span><a name="line-176"></a><span>    </span><a name="local-6989586621679133498"><a href="#local-6989586621679133498"><span class="hs-identifier">parsedReq</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier hs-var">P.liftIO</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">NH.parseRequest</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">BCL.unpack</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">BCL.append</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configHost</span><span> </span><a href="#local-6989586621679133496"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">BCL.concat</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rUrlPath</span><span> </span><a href="#local-6989586621679133497"><span class="hs-identifier hs-var">req0</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-177"></a><span>    </span><a name="local-6989586621679133499"><a href="#local-6989586621679133499"><span class="hs-identifier">req1</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier hs-var">P.liftIO</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="OpenAPIPetstore.Core.html#_applyAuthMethods"><span class="hs-identifier hs-var">_applyAuthMethods</span></a><span> </span><a href="#local-6989586621679133497"><span class="hs-identifier hs-var">req0</span></a><span> </span><a href="#local-6989586621679133496"><span class="hs-identifier hs-var">config</span></a><span>
</span><a name="line-178"></a><span>    </span><span class="hs-identifier hs-var">P.when</span><span>
</span><a name="line-179"></a><span>        </span><span class="hs-special">(</span><span class="hs-identifier">configValidateAuthMethods</span><span> </span><a href="#local-6989586621679133496"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">&amp;&amp;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">not</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">null</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">rAuthTypes</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679133499"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span>
</span><a name="line-180"></a><span>        </span><span class="hs-special">(</span><span class="hs-identifier hs-var">E.throw</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="OpenAPIPetstore.Core.html#AuthMethodException"><span class="hs-identifier hs-var">AuthMethodException</span></a><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-string">&quot;AuthMethod not configured: &quot;</span><span> </span><span class="hs-operator hs-var">&lt;&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">head</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">rAuthTypes</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679133499"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span>
</span><a name="line-181"></a><span>    </span><span class="hs-keyword">let</span><span> </span><a name="local-6989586621679133500"><a href="#local-6989586621679133500"><span class="hs-identifier">req2</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679133499"><span class="hs-identifier hs-var">req1</span></a><span> </span><span class="hs-operator hs-var">&amp;</span><span> </span><a href="OpenAPIPetstore.Core.html#_setContentTypeHeader"><span class="hs-identifier hs-var">_setContentTypeHeader</span></a><span> </span><span class="hs-operator hs-var">&amp;</span><span> </span><a href="OpenAPIPetstore.Core.html#_setAcceptHeader"><span class="hs-identifier hs-var">_setAcceptHeader</span></a><span>
</span><a name="line-182"></a><span>        </span><a name="local-6989586621679133501"><a href="#local-6989586621679133501"><span class="hs-identifier">reqHeaders</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-string">&quot;User-Agent&quot;</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-var">WH.toHeader</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configUserAgent</span><span> </span><a href="#local-6989586621679133496"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-identifier">paramsHeaders</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679133500"><span class="hs-identifier hs-var">req2</span></a><span class="hs-special">)</span><span>
</span><a name="line-183"></a><span>        </span><a name="local-6989586621679133502"><a href="#local-6989586621679133502"><span class="hs-identifier">reqQuery</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH.renderQuery</span><span> </span><span class="hs-identifier hs-var">True</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">paramsQuery</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679133500"><span class="hs-identifier hs-var">req2</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><a name="line-184"></a><span>        </span><a name="local-6989586621679133503"><a href="#local-6989586621679133503"><span class="hs-identifier">pReq</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679133498"><span class="hs-identifier hs-var">parsedReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH.method</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rMethod</span><span> </span><a href="#local-6989586621679133500"><span class="hs-identifier hs-var">req2</span></a><span class="hs-special">)</span><span>
</span><a name="line-185"></a><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">NH.requestHeaders</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679133501"><span class="hs-identifier hs-var">reqHeaders</span></a><span>
</span><a name="line-186"></a><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">NH.queryString</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679133502"><span class="hs-identifier hs-var">reqQuery</span></a><span>
</span><a name="line-187"></a><span>                        </span><span class="hs-special">}</span><span>
</span><a name="line-188"></a><span>    </span><a name="local-6989586621679133508"><a href="#local-6989586621679133508"><span class="hs-identifier">outReq</span></a></a><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">paramsBody</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679133500"><span class="hs-identifier hs-var">req2</span></a><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><a name="line-189"></a><span>        </span><a href="OpenAPIPetstore.Core.html#ParamBodyNone"><span class="hs-identifier hs-var">ParamBodyNone</span></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133503"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH.requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">mempty</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><a name="line-190"></a><span>        </span><a href="OpenAPIPetstore.Core.html#ParamBodyB"><span class="hs-identifier hs-var">ParamBodyB</span></a><span> </span><a name="local-6989586621679133504"><a href="#local-6989586621679133504"><span class="hs-identifier">bs</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133503"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH.requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH.RequestBodyBS</span><span> </span><a href="#local-6989586621679133504"><span class="hs-identifier hs-var">bs</span></a><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><a name="line-191"></a><span>        </span><a href="OpenAPIPetstore.Core.html#ParamBodyBL"><span class="hs-identifier hs-var">ParamBodyBL</span></a><span> </span><a name="local-6989586621679133505"><a href="#local-6989586621679133505"><span class="hs-identifier">bl</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133503"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH.requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH.RequestBodyLBS</span><span> </span><a href="#local-6989586621679133505"><span class="hs-identifier hs-var">bl</span></a><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><a name="line-192"></a><span>        </span><a href="OpenAPIPetstore.Core.html#ParamBodyFormUrlEncoded"><span class="hs-identifier hs-var">ParamBodyFormUrlEncoded</span></a><span> </span><a name="local-6989586621679133506"><a href="#local-6989586621679133506"><span class="hs-identifier">form</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133503"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH.requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH.RequestBodyLBS</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">WH.urlEncodeForm</span><span> </span><a href="#local-6989586621679133506"><span class="hs-identifier hs-var">form</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><a name="line-193"></a><span>        </span><a href="OpenAPIPetstore.Core.html#ParamBodyMultipartFormData"><span class="hs-identifier hs-var">ParamBodyMultipartFormData</span></a><span> </span><a name="local-6989586621679133507"><a href="#local-6989586621679133507"><span class="hs-identifier">parts</span></a></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-var">NH.formDataBody</span><span> </span><a href="#local-6989586621679133507"><span class="hs-identifier hs-var">parts</span></a><span> </span><a href="#local-6989586621679133503"><span class="hs-identifier hs-var">pReq</span></a><span>
</span><a name="line-194"></a><span>
</span><a name="line-195"></a><span>    </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a href="#local-6989586621679133508"><span class="hs-identifier hs-var">outReq</span></a><span class="hs-special">)</span><span>
</span><a name="line-196"></a><span>
</span><a name="line-197"></a><span class="hs-comment">-- | modify the underlying Request</span><span>
</span><a name="line-198"></a><span class="hs-identifier">modifyInitRequest</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679132848"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132849"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132850"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132851"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH.Request</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier hs-type">NH.Request</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679132848"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132849"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132850"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132851"><span class="hs-identifier hs-type">accept</span></a><span>
</span><a name="line-199"></a><a name="modifyInitRequest"><a href="OpenAPIPetstore.Client.html#modifyInitRequest"><span class="hs-identifier">modifyInitRequest</span></a></a><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679133509"><a href="#local-6989586621679133509"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><a name="local-6989586621679133510"><a href="#local-6989586621679133510"><span class="hs-identifier">f</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133510"><span class="hs-identifier hs-var">f</span></a><span> </span><a href="#local-6989586621679133509"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span>
</span><a name="line-200"></a><span>
</span><a name="line-201"></a><span class="hs-comment">-- | modify the underlying Request (monadic)</span><span>
</span><a name="line-202"></a><span class="hs-identifier">modifyInitRequestM</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Monad</span><span> </span><a href="#local-6989586621679132843"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-glyph">=&gt;</span><span> </span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679132844"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132845"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132846"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132847"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH.Request</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><a href="#local-6989586621679132843"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-identifier hs-type">NH.Request</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><a href="#local-6989586621679132843"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679132844"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679132845"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679132846"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679132847"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span>
</span><a name="line-203"></a><a name="modifyInitRequestM"><a href="OpenAPIPetstore.Client.html#modifyInitRequestM"><span class="hs-identifier">modifyInitRequestM</span></a></a><span> </span><span class="hs-special">(</span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679133511"><a href="#local-6989586621679133511"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><a name="local-6989586621679133512"><a href="#local-6989586621679133512"><span class="hs-identifier">f</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">fmap</span><span> </span><a href="OpenAPIPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679133512"><span class="hs-identifier hs-var">f</span></a><span> </span><a href="#local-6989586621679133511"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span>
</span><a name="line-204"></a><span>
</span><a name="line-205"></a><span class="hs-comment">-- ** Logging </span><span>
</span><a name="line-206"></a><span>
</span><a name="line-207"></a><span class="hs-comment">-- | Run a block using the configured logger instance</span><span>
</span><a name="line-208"></a><span class="hs-identifier">runConfigLog</span><span>
</span><a name="line-209"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P.MonadIO</span><span> </span><a href="#local-6989586621679132842"><span class="hs-identifier hs-type">m</span></a><span>
</span><a name="line-210"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679132842"><span class="hs-identifier hs-type">m</span></a><span>
</span><a name="line-211"></a><a name="runConfigLog"><a href="OpenAPIPetstore.Client.html#runConfigLog"><span class="hs-identifier">runConfigLog</span></a></a><span> </span><a name="local-6989586621679133513"><a href="#local-6989586621679133513"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><a href="#local-6989586621679133513"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679133513"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span>
</span><a name="line-212"></a><span>
</span><a name="line-213"></a><span class="hs-comment">-- | Run a block using the configured logger instance (logs exceptions)</span><span>
</span><a name="line-214"></a><span class="hs-identifier">runConfigLogWithExceptions</span><span>
</span><a name="line-215"></a><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">E.MonadCatch</span><span> </span><a href="#local-6989586621679132841"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">P.MonadIO</span><span> </span><a href="#local-6989586621679132841"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span>
</span><a name="line-216"></a><span>  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-identifier hs-type">T.Text</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.Core.html#OpenAPIPetstoreConfig"><span class="hs-identifier hs-type">OpenAPIPetstoreConfig</span></a><span> </span><span class="hs-glyph">-&gt;</span><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679132841"><span class="hs-identifier hs-type">m</span></a><span>
</span><a name="line-217"></a><a name="runConfigLogWithExceptions"><a href="OpenAPIPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier">runConfigLogWithExceptions</span></a></a><span> </span><a name="local-6989586621679133514"><a href="#local-6989586621679133514"><span class="hs-identifier">src</span></a></a><span> </span><a name="local-6989586621679133515"><a href="#local-6989586621679133515"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="OpenAPIPetstore.Client.html#runConfigLog"><span class="hs-identifier hs-var">runConfigLog</span></a><span> </span><a href="#local-6989586621679133515"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">.</span><span> </span><a href="OpenAPIPetstore.LoggingKatip.html#logExceptions"><span class="hs-identifier hs-var">logExceptions</span></a><span> </span><a href="#local-6989586621679133514"><span class="hs-identifier hs-var">src</span></a><span>
</span><a name="line-218"></a></pre></body></html>